#pragma once

class LimitCalculator
{
public:
	explicit LimitCalculator(int preSettlementPrice, int unit, double percent)
		:m_preSettlementPrice(preSettlementPrice),m_unit(unit)
	{
		int upperTemp = int(preSettlementPrice* (1 + percent));
		m_upperLimit = upperTemp - upperTemp%unit;

		int lowerTemp = int(preSettlementPrice* (1 - percent));
		m_lowerLimit = lowerTemp - lowerTemp%unit;
	}
	int GetUpperLimit() const { return m_upperLimit; }
	int GetLowerLimit() const { return m_lowerLimit; }
private:
	int m_preSettlementPrice;
	int m_unit;
	int m_upperLimit;
	int m_lowerLimit;
};